package com.spring.arch.common.enums;

import lombok.Getter;

/**
 * 用户状态
 *
 * @author Frank
 */
public enum UserStatus {

	/**
	 * 激活
	 */
	ACTIVE("Active", "A"),

	/**
	 * 不活跃
	 */
	INACTIVE("Inactive", "I"),

	/**
	 * 已删除
	 */
	DELETED("Deleted", "D"),

	/**
	 * 已锁定
	 */
	LOCKED("Locked", "L"),

	/**
	 * 已创建
	 */
	CREATED("Created", "C"),

	/**
	 * 待激活
	 */
	PENDING_ACTIVATION("Pending Activation", "PEA"),

	/**
	 * 临时锁定的凭证
	 */
	TEMP_LOCKED_BAD_CREDENTIALS("Temp Locked Bad Credentials", "TELBC");

	@Getter
	private String label;

	@Getter
	private String value;

	UserStatus(String label, String value) {
		this.label = label;
		this.value = value;
	}

	public static UserStatus getEnum(String value) {
		for (UserStatus item : UserStatus.values()) {
			if (item.getValue().equalsIgnoreCase(value)) {
				return item;
			}
		}
		return null;
	}
}